//
//  NewsTableViewCell.m
//  CPU_Utility
//
//  Created by leonardo on 15/10/22.
//  Copyright © 2015年 leonardo. All rights reserved.
//


#import "NewsTableViewCell.h"

#import <UIImageView+WebCache.h>
@interface NewsTableViewCell()


@property (weak, nonatomic) IBOutlet UIImageView *imageViewFirst;
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
@property (weak, nonatomic) IBOutlet UILabel *labelPubDate;
@property (weak, nonatomic) IBOutlet UILabel *labelSource;
@end

@implementation NewsTableViewCell{
    

}

- (void)awakeFromNib {
    [super awakeFromNib];
    
}
-(void)configWith:(Content *)contentModel{
    [_imageViewFirst setContentMode:UIViewContentModeScaleToFill];
    if (!contentModel.imageurls.count) {
        
        [_imageViewFirst setImage:[UIImage imageNamed:@"wawa"]];
        
    }
    else{
        [_imageViewFirst sd_setImageWithURL: [contentModel.imageurls[0] url] placeholderImage:[UIImage imageNamed:@"wawa"]];
        
    }
    _labelTitle.text = contentModel.title;
    _labelSource.text = contentModel.source;
    _labelPubDate.text = contentModel.pubDate;
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
   
    
    
    // Configure the view for the selected state
}

@end
